package com.DataWrapper;

import com.Core.GameEngine;

import android.view.MotionEvent;

public class EventTracker
{	public int action;
	public float x,y;
	public int curX,curY;
	private boolean touching;
	private final int NAv=-1; 
	
	public EventTracker()
	{	action = MotionEvent.ACTION_CANCEL;
		x=0; y=0;
		touching=false;
		curX=NAv;curY=NAv;
	}
	public void Set(int act, float X, float Y)
	{	action = act;
		x = X; y = Y;
		touching=true;
		int _x=(int)X,_y=(int)Y;
		if (x<GameEngine.MAP_SIZE && y <GameEngine.MAP_SIZE)
		{	if (_x!=curX || _y!=curY)
			{	GameEngine.logic.RemoveAniMark();
				curX=_x;curY=_y;
				GameEngine.logic.SetAniMark();
			}
		}
		else
		{	curX=NAv;curY=NAv;
		}
	}
	public void SetTaboo()
	{	curX=NAv;curY=NAv;
	}
	public boolean isPosAvail()
	{	return (curX!=NAv && curY!=NAv);
	}
	public boolean isTouchingScreen()
	{	return touching;
	}
}
